<?php
    require_once '../kefu.php';
    require_once '../user.php';
    if(isset($_POST['msg'])){
        $kefu = new kefu(); 
        echo $kefu->sendMsg($_POST['openid'], $_POST['msg']);
    }
?>
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <div>文件上传</div>
        <form action="" method="post">
            <div>
                <?php
                    $user = new user();
                    $userList = $user->getUserList();
                    echo '<select name="openid">';
                    foreach ($userList as $key => $value) {
                        echo '<option value="'.$value['openid'].'">'.$value['nickname'].'</option>';
                    }
                    echo '</select>';
                ?>
            </div>
            <div>
                <input type="text" name="msg" value="" />
            </div>
            <div>
                <input type="submit" value="提交" />
            </div>
        </form>
    </body>
</html>
